<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div id="test"></div>

  <script src="../js/react.development.js"></script>
  <script src="../js/react-dom.development.js"></script>
  <script src="../js/babel.min.js"></script>
  <script type="text/babel">
    let names = ['A', 'B', 'C', 'D'];
    // 将数组的内容以 列表的形式显示在 页面中
    
    // 1. 创建虚拟DOM
    const ul = (
      <ul>
        {
          names.map( (name, index) => <li key={ name }>{ name }</li> )
        }
      </ul>
    );
    ReactDOM.render(
      ul,
      // 2. 渲染到页面
      document.getElementById('test')
    )
  </script>
</body>

</html>